<script setup>
import router from "@/router/routeIndex.js";

const handleSelect = (key, keyPath) => {
    console.log(key, keyPath)
    switch (key) {
        case 'home':
            router.push('/home')
            break
        case 'logout':
            // 执行登出操作
            break
        case 'switchBusiness':
            // 切换业务系统
            break
        case 'switchManager':
            // 切换管理系统
            break
    }
}

</script>

<template>
    <el-menu default-active="1" class="el-menu-demo" mode="horizontal" :ellipsis="false" @select="handleSelect">
        <el-menu-item class="system-name" index="home">系统名称后台管理系统</el-menu-item>
        <el-menu-item v-if="true" index="switchBusiness">切换业务系统</el-menu-item>
        <el-menu-item v-else index="switchManager">切换管理系统</el-menu-item>
        <el-sub-menu index="2">
            <template #title>管理员</template>
            <el-menu-item index="logout">安全退出</el-menu-item>
        </el-sub-menu>

    </el-menu>
</template>

<style scoped lang="scss">
.el-menu--horizontal > .el-menu-item:nth-child(1) {
    margin-right: auto;
}

.system-name {
    font-size: 30px;
}

</style>
